package com.example.healthcondition.controller;


import com.example.healthcondition.services.HealthReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/login/home/healthReports")
public class HealthReportsController {

    private final HealthReportsService healthReportsService;

    @Autowired
    public HealthReportsController(HealthReportsService healthReportsService) {
        this.healthReportsService = healthReportsService;
    }

    @PostMapping("/generate/{userId}")
    public ResponseEntity<Integer> generateHealthReport(@PathVariable Integer userId) {
        int result = healthReportsService.generateHealthReport(userId);
        return ResponseEntity.ok(result);
    }
}